package com.ordersystem.demo.serviceImpl;

import com.ordersystem.demo.model.ProductInfo;
import com.ordersystem.demo.respoistory.ProductInfoRespoistory;
import com.ordersystem.demo.service.ProductInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.ExceptionHandler;

import java.math.BigDecimal;
import java.util.List;

@Service
public class ProductInfoServiceImpl implements ProductInfoService {

    @Autowired
    private ProductInfoRespoistory respoistory;

    @Override
    public List<ProductInfo> findAll() {
        return respoistory.findAll();
    }

    @Override
    public ProductInfo findByProductIdAndProductStatus(String productId,Integer productStatus) {
        return respoistory.findOneByProductIdAndProductStatus(productId,productStatus);
    }

    @Override
    public ProductInfo save(ProductInfo productInfo) {
        return respoistory.save(productInfo);
    }

}
